package ais.dcproject.service.impl;

import java.util.List;

import ais.dcproject.dao.DropListDao;
import ais.dcproject.model.Special;
import ais.dcproject.service.DropListService;
import ais.dcproject.util.JsonUtil;

public class DropListServiceImpl implements DropListService{
	
	private DropListDao dropListDao;
	
	public void setDropListDao(DropListDao dropListDao) {
		this.dropListDao = dropListDao;
	}
	@Deprecated
	public String getAllDepartments() {
		return null;
	}

	public String getAllSpecialsByDepartmentId(Integer departmentId) {
		List<Special> specialList = dropListDao.queryAllSpecialsByDepartmentId(departmentId);
//		Iterator<Special> iterator = specialList.iterator();
//		while(iterator.hasNext()){
//			Special special = iterator.next();
//			System.out.println(special.toString());
//		}
		String result = JsonUtil.listToJson(specialList);
		System.out.println(result);
		return result;
	}

}
